//
//  EvaluateCell.m
//  KiklinkApp
//
//  Created by LJC on 14-9-15.
//  Copyright (c) 2014年 Kiklink. All rights reserved.
//

#import "EvaluateCell.h"

#import "UIColor+hex.h"

@implementation EvaluateCell

- (void)awakeFromNib
{
    self.seperateView.backgroundColor = [UIColor colorWithHexString:AppColor_BackGround];
    [self.evaluateButton.layer setMasksToBounds:YES];
    [self.evaluateButton.layer setCornerRadius:2];
    self.evaluateButton.backgroundColor = [UIColor colorWithHexString:AppColor_Main];
    
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)loadData
{
    self.titleLabel.text = @"浮潜-潜水啊";
    self.orderNumber.text = @"11111";
    self.orderTime.text = @"2014年9月15日";
    self.priceLabel.text = @"300";
}

- (void)loadDataWithOrderItem:(OrderItem *)orderItem
{
    self.titleLabel.text = orderItem.productName;
    self.orderNumber.text = [NSString stringWithFormat:@"%@",orderItem.orderid];
    
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateStyle:NSDateFormatterMediumStyle];
    [formatter setTimeStyle:NSDateFormatterShortStyle];
    [formatter setDateFormat:@"YYYY年MM月dd日"];
    
    NSDate *orderDate = [NSDate dateWithTimeIntervalSince1970:(long long)(orderItem.createtimelong/1000)];
    NSString *orderDateStr = [formatter stringFromDate:orderDate];
    
    self.orderTime.text = orderDateStr;
    self.priceLabel.text = [NSString stringWithFormat:@"%@",orderItem.price];
}

@end
